// 定义一些路由
import IndexPage from "../pages/IndexPage.vue";
import UserLoginPage from "../pages/user/UserLoginPage.vue";
import UserPage from "../pages/user/UserPage.vue";
import UserWritePage from "../pages/user/UserWritePage.vue";
import UserEditPage from "../pages/user/UserEditPage.vue";
import PostWritePage from "../pages/post/PostWritePage.vue";
import DiaryEditPage from "../pages/DiaryEditPage.vue";
import SocialPage from "../pages/SocialPage.vue";
import PostDetailsPage from "../pages/post/PostDetailsPage.vue";
import DatePage from "../pages/DatePage.vue";
import SearchPage from "../pages/SearchPage.vue";
import UserRegisterPage from "../pages/user/UserRegisterPage.vue";
import AdminLoginPage from "../pages/manager/AdminLoginPage.vue";
import AdminIndexPage from "../pages/manager/AdminIndexPage.vue";
import AdminUserPage from "../pages/manager/AdminUserPage.vue";
import AdminPostPage from "../pages/manager/AdminPostPage.vue";

const routes = [
    {
        path: '/user/register', component: UserRegisterPage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/user/login', component: UserLoginPage,
        meta: {
            showNav: true
        }
    },
    {
      path: '/admin/login', component: AdminLoginPage,
      meta: {
          showNav: true
      }
    },
    {
        path: '/', component: IndexPage,
    },
    {
        path: '/user', component: UserPage,
    },
    {
        path: '/admin', component: AdminIndexPage,
        meta: {
            showNav: true
        },
        children: [
            {
                path: 'user', component: AdminUserPage,
            },
            {
                path: 'post', component: AdminPostPage,
            },
            {
                path: '', component: '',
            }
        ]
    },

    {
        path: '/user/write', component: UserWritePage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/user/edit', component: UserEditPage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/diary/edit', component: DiaryEditPage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/social/write', component: PostWritePage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/search', component: SearchPage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/social', component: SocialPage,
    },
    {
        path: '/social/info', component: PostDetailsPage,
        meta: {
            showNav: true
        }
    },
    {
        path: '/date', component: DatePage,
    },
]

export default routes;